#ifndef __CONNECTION_WIDGET__
#define __CONNECTION_WIDGET__ 1

#include <QWidget>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>

#include "client_connection.h"

/**
 * @brief this is the actual control for the stegit-2 control
 * @author rpoisel
 */

class CConnectionWidget : public QWidget
{
	 Q_OBJECT

public:
	CConnectionWidget(QWidget* pParent = 0);
	virtual ~CConnectionWidget();

	void clientConnected(QString& pHost, quint16& pPort);
	void clientDisconnected();
	void connectionError();

	static const QString sDefaultHostname;
	static const QString sDefaultPort;

signals:
	void connectRequested(QString, quint16);
	void startRequested();
	void disconnectRequested();

private slots:
	void connectClicked();
	void startClicked();
	void disconnectClicked();

private:
	QHBoxLayout mLayout;
	QPushButton mConnectButton;
	QPushButton mDisconnectButton;
	QLabel mHostnameLabel;
	QLineEdit mHostnameEdit;
	QLabel mPortLabel;
	QLineEdit mPortEdit;

	CClientConnection* mClientConnection;

	void setupUiElements();
	void setupActions();
};

#endif /* __CONNECTION_WIDGET__ */

